<template>
	<view class="body">
		<xk-header :headerbg="true" :back="true" title="我的合同"></xk-header>

		<view class="list-info">
			<view class="list-item" v-for="(item, index) of dataList" :key="index" @click="goDetail(item)">
				<view>合同编号：{{item.contract_code}}</view>
				<view>{{item.contract_name}}</view>
				<image mode="aspectFill" class="jiantou" src="/static/jiantou.png"/>
			</view>
		</view>

	</view>
</template>

<script>
	let noImg = '/static/no-img.png';
	export default {
		data() {
			return {
				dataList: []
			};
		},
		onLoad(){
			this.initInfo()
		},
		onShow() {
		},
		methods:{
			initInfo() {
				this.$api.mySelf_getMyContractList().then(res=>{
					console.warn("我的合同列表信息： ", res)
					for (let item of res) {
						this.dataList.push(item)
					}
				})
			},

			goDetail(item) {
				uni.navigateTo({
					url: "/pagesC/contract/contract-detail?data="+JSON.stringify(item)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.list-info {
	display: flex;
	padding: 30rpx;
	flex-direction: column;
	.list-item {
		display: flex;
		align-items: center;
		flex: 1;
		background-color: #FFFFFF;
		height: 50rpx;
		padding: 30rpx 20rpx;
		margin-bottom: 20rpx;

		:first-child {
			flex: 1;
		}

		.jiantou {
			width: 14rpx;
			height: 24rpx;
			margin-left: 10rpx;
		}
	}
}
</style>
